(function() {"use strict";var __module = CC_EDITOR ? module : {exports:{}};var __filename = 'preview-scripts/assets/Script/hurtSprites.js';var __require = CC_EDITOR ? function (request) {return cc.require(request, require);} : function (request) {return cc.require(request, __filename);};function __define (exports, require, module) {"use strict";
cc._RF.push(module, '54a8cALKypHC5kMovPov9sW', 'hurtSprites', __filename);
// Script/hurtSprites.js

'use strict';

var _allVariable = require('./allVariable');

var _allVariable2 = _interopRequireDefault(_allVariable);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

cc.Class({
  extends: cc.Component,

  properties: {
    hurtSound: {
      default: null,
      type: cc.AudioClip
    }
  },

  // LIFE-CYCLE CALLBACKS:

  onLoad: function onLoad() {},
  start: function start() {},


  hurtClick: function hurtClick() {
    console.log('受到伤害');
    if (_allVariable2.default.SourceChange == false) {
      this.current = cc.audioEngine.play(this.hurtSound, false, 1);
    }
  },

  onEnable: function onEnable() {
    this.node.on('touchstart', this.hurtClick, this);
  },

  onDisable: function onDisable() {
    this.node.off('touchstart', this.hurtClick, this);
  },

  init: function init() {

    if (_allVariable2.default.isEnterEndTimes == true) {

      console.log("进入倒计时时间不显示伤害界面");
    } else {

      var interval = 1;
      // 重复次数
      var repeat = 3;
      // 开始延时
      var delay = 0;

      this.schedule(function () {

        var opaction = cc.fadeTo(0.25, 100);

        var opaction2 = cc.fadeTo(0.25, 200);

        var opaction3 = cc.fadeTo(0.25, 100);

        var opaction4 = cc.fadeTo(0.25, 200);

        var seq = cc.sequence(opaction, opaction2, opaction3, opaction4);

        this.node.runAction(seq);
      }, interval, repeat, delay);
    }
  }
});

cc._RF.pop();
        }
        if (CC_EDITOR) {
            __define(__module.exports, __require, __module);
        }
        else {
            cc.registerModuleFunc(__filename, function () {
                __define(__module.exports, __require, __module);
            });
        }
        })();
        //# sourceMappingURL=hurtSprites.js.map
        